<?php
use_stylesheet('list.css');
use_helper('Text');

slot('PageTitle',$dev." Network Status Monitor");
slot('Title',$dev." Network Status Monitor");
?>

<table id="lista"> 
<thead>
    <tr>
      <th>Plant</th>
      <th>Device</th>
      <th>Check Time</th>
      <th>Status</th>
      <th>Latency</th>
    </tr>
  </thead>
  
  <tbody>
    <?php
      foreach ($devChecks as $key=>$check): 
        $odd = fmod($key, 2) ? 'odd' : 'even';
          ?>
   <tr class="<?php echo $odd ?>">
      <td ><?php echo $dev->getPlant() ?></td>
      <td ><?php echo $dev->getName() ?></td>
      <td ><?php echo $check->getChecktime() ?></td>
<?php $result=($check->getResult()==1)?"Connected":"No Link";
      $light=($check->getResult()==1)?"greenlight":"redlight";?>
      <td class="<?php echo $light ?>"><?php echo $result ?></td>
      <td ><?php echo $check->getLatency()."  ms" ?></td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>

